package com.danbay.cloud.account.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author SJG
 *         2017/12/19.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("账户信息")
public class AccountDto {
    /**
     * 主键 登录账号(手机号、邮箱..)
     */
    @ApiModelProperty("账号")
    @NotBlank(message = "账户名不能为空")
    private String userName;

    /**
     * '别名'
     */
    @ApiModelProperty("别名")
    private String nickName;

    /**
     * 手机号
     */
    @ApiModelProperty("手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "1[\\d]{10}", message = "手机号为 1 开头的 11 位数字")
    private String phoneNum;

    @ApiModelProperty("账户组")
    @NotNull(message = "账户组ID不能为空")
    private Integer accountGroup;

    @ApiModelProperty("密码")
    private String password;

}
